package com.example.courtcounter;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    TextView score,score1;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        score=(TextView) findViewById(R.id.score);
        score1=(TextView) findViewById(R.id.score1);

    }
    public void btn13(View btn){
        showscoreA(3);
    }
    public void btn12(View btn){
        showscoreA(2);

    }
    public void btn11(View btn){
        showscoreA(1);

    }
    public void btn23(View btn){
        showscoreB(3);

    }
    public void btn22(View btn){
        showscoreB(2);
    }
    public void btn21(View btn){
        showscoreB(1);

    }
    public void btn(View btn){
        score.setText("0");
        score1.setText("0");
    }
    public void showscoreA(int inc){
        String oldscore = (String)score.getText();
        int newscore = Integer.parseInt(oldscore)+inc;
        score.setText("" + newscore);
    }
    public void showscoreB(int inc){
        String oldscore1 = (String)score1.getText();
        int newscore1 = Integer.parseInt(oldscore1)+inc;
        score1.setText("" + newscore1);
    }
}